package com.aizuda.boot.modules.common.constant.enums;

/**
 * 权限选项类型枚举
 * 
 * @author system
 * @version 1.0
 * @date 2025/1/27
 */
public enum PermissionOptionType {

    MY_CONTRACT("myContract", "我的合同"),
    CONTRACT_AGENT("contractAgent", "合同经办人为我的合同"),
    ALL_CONTRACT("allContract", "全部合同"),
    CONTRACT_LEDGER("contractLedger", "合同台账"),
    APPROVAL_RECORD("approvalRecord", "审批记录"),
    ARCHIVE_MAIN("archiveMain", "归档主文件"),
    ARCHIVE_ATTACHMENT("archiveAttachment", "归档附件")
    ;

    private final String code;
    private final String description;

    PermissionOptionType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据code获取枚举
     */
    public static PermissionOptionType getByCode(String code) {
        for (PermissionOptionType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
} 